﻿using System.Windows;
using AppfabricAdministrator.Commands.Cluster;

namespace AdminMainUI
{
    /// <summary>
    /// Interaction logic for ClusterSecurityWindow.xaml
    /// </summary>
    public partial class ClusterSecurityWindow : Window
    {
        private ClusterSecurity clusterConfig = null;

        public ClusterSecurityWindow()
        {
            InitializeComponent();
            this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
        }

        private void btnClose_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            clusterConfig = new ClusterSecurity();
            clusterConfig.Parameters["ProtectionLevel"] = cmbProtection.SelectionBoxItem.ToString();
            clusterConfig.Parameters["SecurityMode"] = cmbSecurityMode.SelectionBoxItem.ToString();
            this.Close();
        }

        public ClusterSecurity ShowSecurityWindow()
        {
            this.ShowDialog();
            return clusterConfig;
        }
    }
}
